set APK=%1
set DEST=%2
set IS_CHANNEL=%3
set JAR_PATH=%4
set ACCOUNT=%5
set PASSWORD=%6
set SIGN=%7

echo %APK%
echo "------ JiaGu  running..."

md %DEST%
java -jar %JAR_PATH%jiagu.jar -login %ACCOUNT% %PASSWORD%
java -jar %JAR_PATH%jiagu.jar -importsign %SIGN%

if "%IS_CHANNEL%"=="1" (java -jar %JAR_PATH%jiagu.jar -importmulpkg ../jiagu/channels.txt)

java -jar %JAR_PATH%jiagu.jar -showsign

set pack=" "

if "%IS_CHANNEL%"=="1" (set pack=-automulpkg)

java -jar %JAR_PATH%jiagu.jar  -jiagu %APK% %DEST% -autosign %pack%

echo "------ JiaGu  finished!"